<template>
  <el-dialog
    title="合作列表"
    :visible.sync="dataListLoading"
    @close="cancelAdd"
  >
  <div class="mod-marketing-coupon">
    <div class="main-container">
      <div class="table-con coupon-table">
        <el-table
          ref="couponListTable"
          :data="dataList"
          header-cell-class-name="table-header"
          row-class-name="table-row-low"
          style="width: 100%">

          <el-table-column
            prop="name"
            label="姓名"
            >
          </el-table-column>
          <el-table-column
            prop="companyName"
            label="公司"
            >
          </el-table-column>
          <el-table-column
            prop="phone"
            label="联系电话"
            >
          </el-table-column>

          <el-table-column
            prop="requirements"
            label="合作要求"
            >
          </el-table-column>
          <el-table-column
            prop="createTime"
            label="登记时间"
            >
          </el-table-column>
        </el-table>
      </div>
      <el-pagination
        v-if="dataList.length"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="page.current"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="page.size"
        layout="total, sizes, prev, pager, next, jumper"
        :total="page.total">
      </el-pagination>
    </div>
  </div>
  </el-dialog>
</template>

<script>
  export default {
    data () {
      return {
        dataList: [],
        dataListLoading: false,
        page: {
          total: 0, // 总页数
          current: 1, // 当前页数
          size: 10 // 每页显示多少条
        },
        searchForm: {
        }
      }
    },
    methods: {
      getDataList () {
        this.dataListLoading = true
        this.$http({
          url: this.$http.adornUrl('/admin/project/project/getProjectRegList'),
          method: 'get',
          params: this.$http.adornParams(
            Object.assign(
              this.page,
              this.searchForm
            ), false
          )
        }).then(({ data }) => {
          this.dataList = data.records
          this.page.total = data.total
        })
      },
      // 条件查询
      searchChange () {
        this.page.total = 0
        this.page.current = 1
        this.getDataList()
      },
      handleSizeChange (val) {
        this.page.size = val
        this.getDataList()
      },
      handleCurrentChange (val) {
        this.page.current = val
        this.getDataList()
      },
      cancelAdd: function () {
        this.dataListLoading = false
      }
    }
  }
</script>
<style lang="scss" scoped>
  .marginBottom{margin-bottom:20px}
</style>
